package io.gitee.minelx.filesystem;

import io.gitee.minelx.filesystem.init.OpenPolicy;
import io.gitee.minelx.filesystem.provider.FS;

import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;

public class TutorialMainTest {
    public static void main(String[] args) {
        FileSystem firstFileSystem = FileSystems.getFileSystem(URI.create("file:///"));
        FileSystem secondFileSystem = FileSystems.getDefault();

        Path firstPath = firstFileSystem.getPath("/dirName", "file.txt");
        Path secondPath = secondFileSystem.getPath("/dirName", "file.txt");
        System.out.println("firstPath = " + firstPath);
        System.out.println("secondPath = " + secondPath);
        System.out.println("firstPath.equals(secondPath) = " + firstPath.equals(secondPath));

        Directory a = FS.of(firstFileSystem)
                .locate().dir("home", OpenPolicy.EXISTS)
                .child().dir("es", OpenPolicy.EXISTS)
                ;
        System.out.println("a = " + a);
    }
}
